<?php
/**
 *  广告数据生成
 */
use Faker\Generator as Faker;

$factory->define(App\Models\Ad::class, function (Faker $faker) {

    $title = $faker->words(3, $asText = true);


    $updated_at = $faker->dateTimeThisMonth();
    // 传参为生成最大时间不超过，创建时间永远比更改时间要早
    $created_at = $faker->dateTimeThisMonth($updated_at);

    return [
        'title' => $title,
        'color' => $faker->rgbCssColor,
        'border_color' => $faker->rgbCssColor,
        'size' => $faker->numberBetween(8,36),
        'flicker' => $faker->numberBetween(0,1),
        'link' => $faker->url,
        'created_at' => $created_at,
        'updated_at' => $updated_at,
    ];
});
